<template>
  <j-modal title="审批记录单" :width="width" :visible="visible" switchFullscreen @ok="exportExcel"
    :okButtonProps="{ class: { 'jee-hidden': disableSubmit1 } }"
    :cancelButtonProps="{ class: { 'jee-hidden': disableSubmit1 } }" @cancel="handleCancel" cancelText="取消" okText="打印">

    <section ref="print" id="printContent">
      <h1 style="text-align: center">审批记录单</h1>
      <!--付款申请审批-->
      <table border="1" height="200px" bordercolor="#999" v-if="receiptsModel === '1'" style="margin-bottom: 5px;font-size: 13px;">
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">标题</td>
          <td align="center" colspan="5" style="font-weight:600;">{{ treeData.title }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">审批编号</td>
          <td width="400px">{{ treeData.approvNumber }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">提交时间</td>
          <td width="400px">{{ treeData.submitTime }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">项目</td>
          <td width="400px">{{ treeData.projectName }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">部门</td>
          <td width="400px">{{ treeData.departName }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">发起人</td>
          <td width="400px">{{ treeData.userName }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">职位</td>
          <td width="400px">{{ treeData.post }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">开户银行</td>
          <td width="400px">{{ treeData.bankDeposit }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">银行账号</td>
          <td width="400px">{{ treeData.bankAccount }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">对方名称</td>
          <td width="400px">{{ treeData.other }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">付款项目</td>
          <td width="400px">{{ treeData.paymentProject }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">合同编号</td>
          <td width="400px">{{ treeData.contract }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">付款金额</td>
          <td width="400px">{{ treeData.paymentMoney }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" rowspan="6" style="font-size:13px;height:30px;font-weight:600;">备注</td>
          <td align="left" colspan="5" rowspan="6">{{ treeData.remark }}</td>
        </tr>
      </table>

      <!--材料结算审批-->
      <table border="1" height="200px" bordercolor="#999" v-if="receiptsModel === '2'" style="margin-bottom: 5px;font-size: 13px;">
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">标题</td>
          <td align="center" colspan="5" style="font-weight:600;">{{ treeData.title }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">审批编号</td>
          <td width="400px">{{ treeData.approvNumber }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">提交时间</td>
          <td width="400px">{{ treeData.submitTime }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">项目</td>
          <td width="400px">{{ treeData.projectName }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">部门</td>
          <td width="400px">{{ treeData.departName }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">发起人</td>
          <td width="400px">{{ treeData.userName }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">职位</td>
          <td width="400px">{{ treeData.post }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">供应商</td>
          <td width="400px">{{ treeData.supplierName }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">合同编号</td>
          <td width="400px">{{ treeData.contractNumber }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">结算时间</td>
          <td width="400px">第{{ treeData.period }}期&nbsp;{{ treeData.startTime }}-{{ treeData.endTime }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">材料项目名称</td>
          <td width="400px">{{ treeData.materialsProjectName }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">本期采购数量</td>
          <td width="400px">{{ treeData.currentPurchaseNumber }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">本期金额</td>
          <td width="400px">{{ treeData.currentMoney }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">扣款或惩罚</td>
          <td width="400px">{{ treeData.rewardAndPunish }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">本期结算金额</td>
          <td width="400px">{{ treeData.currentSettlementAmount }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">累计结算金额</td>
          <td width="400px">{{ treeData.accumulatedSettlementAmount }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" rowspan="6" style="font-size:13px;height:30px;font-weight:600;">备注</td>
          <td align="left" colspan="5" rowspan="6">{{ treeData.remark }}</td>
        </tr>
      </table>

      <!--劳务结算审批-->
      <table border="1" height="200px" bordercolor="#999" v-if="receiptsModel === '3'" style="margin-bottom: 5px;font-size: 13px;">
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">标题</td>
          <td align="center" colspan="5" style="font-weight:600;">{{ treeData.title }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">审批编号</td>
          <td width="400px">{{ treeData.approvNumber }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">提交时间</td>
          <td width="400px">{{ treeData.submitTime }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">项目</td>
          <td width="400px">{{ treeData.projectName }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">部门</td>
          <td width="400px">{{ treeData.departName }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">发起人</td>
          <td width="400px">{{ treeData.userName }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">职位</td>
          <td width="400px">{{ treeData.post }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">班组</td>
          <td width="400px">{{ treeData.supplierName }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">合同编号</td>
          <td width="400px">{{ treeData.contractNumber }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">结算时间</td>
          <td width="400px">第{{ treeData.period }}期&nbsp;{{ treeData.startTime }}-{{ treeData.endTime }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">结算项目</td>
          <td width="400px">{{ treeData.settlementAccount }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">本期完成量</td>
          <td width="400px">{{ treeData.currentCompletion }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">扣款或惩罚</td>
          <td width="400px">{{ treeData.rewardAndPunish }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">本期结算金额</td>
          <td width="400px">{{ treeData.currentSettlementAmount }}</td>

          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">累计结算金额</td>
          <td width="400px">{{ treeData.accumulatedSettlementAmount }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" rowspan="6" style="font-size:13px;height:30px;font-weight:600;">备注</td>
          <td align="left" colspan="5" rowspan="6">{{ treeData.remark }}</td>
        </tr>
      </table>

      <!--付款计划审批-->
      <table border="1" height="200px" bordercolor="#999" v-if="receiptsModel === '4'" style="margin-bottom: 5px;font-size: 13px;">
        <tr>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">标题</td>
          <td align="center" colspan="5" style="font-weight:600;">{{ treeData.title }}</td>
        </tr>
        <tr>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">审批编号</td>
          <td width="300px">{{ treeData.approvNumber }}</td>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">提交时间</td>
          <td width="300px">{{ treeData.submitTime }}</td>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">项目</td>
          <td width="300px">{{ treeData.projectName }}</td>
        </tr>
        <tr>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">部门</td>
          <td width="300px">{{ treeData.departName }}</td>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">发起人</td>
          <td width="300px">{{ treeData.userName }}</td>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">职位</td>
          <td width="300px">{{ treeData.post }}</td>
        </tr>
        <tr>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">预计收款-总金额</td>
          <td width="300px">{{ treeData.gatheringTotal }}</td>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">劳务等款项</td>
          <td width="300px">{{ treeData.gatheringPaymentServices }}</td>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">劳务工资</td>
          <td width="300px">{{ treeData.gatheringLaborWages }}</td>
        </tr>
        <tr>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">对下班组计划支付劳务费-总金额</td>
          <td width="300px">{{ treeData.serviceFeeTotal }}</td>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">对下班组计划支付劳务费(其中劳务等款项)</td>
          <td width="300px">{{ treeData.serviceFeePayment }}</td>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">对下班组计划支付劳务费(其中劳务工资)</td>
          <td width="300px">{{ treeData.serviceFeeLaborWages }}</td>
        </tr>
        <tr>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">计划支付材料款项-总金额</td>
          <td width="300px">{{ treeData.gatheringMaterialsTotal }}</td>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">计划支付材料款项(其中材料费)</td>
          <td width="300px">{{ treeData.gatheringMaterialsExpense }}</td>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">计划支付材料款项(其中机械费)</td>
          <td width="300px">{{ treeData.gatheringMaterialsMachine }}</td>
        </tr>
        <tr>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">计划支付材料款项(其他)</td>
          <td width="300px">{{ treeData.gatheringMaterialsOther }}</td>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">项目部直签支出-总金额</td>
          <td width="300px">{{ treeData.projectTotal }}</td>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">项目部直签支出(其中劳务费)</td>
          <td width="300px">{{ treeData.projectFeePayment }}</td>
        </tr>
        <tr>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">项目部直签支出(其中材料费)</td>
          <td width="300px">{{ treeData.projectMaterialsExpense }}</td>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">项目部直签支出(其中机械费)</td>
          <td width="300px">{{ treeData.projectMachineryCost }}</td>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">项目部直签支出(其他)</td>
          <td width="300px">{{ treeData.projectOther }}</td>
        </tr>
        <tr>
          <td align="center" width="500px" style="font-size:13px;height:30px;font-weight:600;">项目部预留备用资金</td>
          <td width="300px" colspan="5">{{ treeData.projectReservedMoney }}</td>
        </tr>
        <tr>
          <td align="center" width="500px" rowspan="6" style="font-size:13px;height:30px;font-weight:600;">备注</td>
          <td align="left" colspan="5" rowspan="6">{{ treeData.remark }}</td>
        </tr>
      </table>

      <!--合同审批-->
      <table border="1" height="200px" bordercolor="#999" v-if="receiptsModel === '5'" style="margin-bottom: 5px;font-size: 13px;">
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">标题</td>
          <td align="center" colspan="5" style="font-weight:600;">{{ treeData.title }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">审批编号</td>
          <td width="400px">{{ treeData.approvNumber }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">提交时间</td>
          <td width="400px">{{ treeData.submitTime }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">发起人</td>
          <td width="400px">{{ treeData.userName }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">职位</td>
          <td width="400px">{{ treeData.post }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">申请部门</td>
          <td width="400px">{{ treeData.departName }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">开始日期</td>
          <td width="400px">{{ treeData.startTime }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">项目</td>
          <td width="400px">{{ treeData.projectName }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">合同名称</td>
          <td width="400px">{{ treeData.name }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">合同期限</td>
          <td width="400px">{{ treeData.deadline }}个月</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">合同份数</td>
          <td width="400px">{{ treeData.number }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">合同金额</td>
          <td width="400px">{{ treeData.money }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">合同编号</td>
          <td width="400px">{{ treeData.contractNumber }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">对方单位名称</td>
          <td width="400px">{{ treeData.other }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">对方单位地址</td>
          <td width="400px">{{ treeData.otherAddress }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">对方单位电话</td>
          <td width="400px">{{ treeData.otherPhone }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" rowspan="6" style="font-size:13px;height:30px;font-weight:600;">备注</td>
          <td align="left" colspan="5" rowspan="6">{{ treeData.remark }}</td>
        </tr>
      </table>
      <!--招采审批-->
      <table border="1" width="100%" height="200px" bordercolor="#999"
        v-if="receiptsModel === '6' || receiptsModel === '7' || receiptsModel === '8' || receiptsModel === '9'"
        style="margin-bottom: 5px;font-size: 13px;">
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">标题</td>
          <td align="center" colspan="5" style="font-weight:600;">{{ treeData.title }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">审批编号</td>
          <td width="400px">{{ treeData.approvNumber }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">提交时间</td>
          <td width="400px">{{ treeData.submitTime }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">发起人</td>
          <td width="400px">{{ treeData.userName }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">职位</td>
          <td width="400px">{{ treeData.post }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">申请部门</td>
          <td width="400px">{{ treeData.departName }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">项目</td>
          <td width="400px">{{ treeData.projectName }}</td>
        </tr>

        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">招采名称</td>
          <td width="400px">{{ treeData.name }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">
            {{(receiptsModel === '7' || receiptsModel === '9')?'物资条数':'分包项目条数'}}
          </td>
          <td width="400px">{{ treeData.number }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">总金额(不含税)</td>
          <td width="400px">{{ treeData.taxExclusiveMoney }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">总金额(含税)</td>
          <td width="400px">{{ treeData.taxInclusiveMoney }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">中标价</td>
          <td width="400px">{{ treeData.biddingPrice }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">
            {{(receiptsModel === '8' || receiptsModel === '9')?'发标时间':'招采开始时间'}}
          </td>
          <td width="400px">{{ treeData.startTime }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;">
            {{(receiptsModel === '8' || receiptsModel === '9')?'结标时间':'招采结束时间'}}
          </td>
          <td width="400px">{{ treeData.endTime }}</td>
          <td align="center" width="400px" style="font-size:13px;height:30px;font-weight:600;" v-if="receiptsModel === '8' || receiptsModel === '9'">招采单号
          </td>
          <td width="400px" v-if="receiptsModel === '8' || receiptsModel === '9'">{{ treeData.biddingNumber }}</td>
        </tr>
        <tr>
          <td align="center" width="400px" rowspan="6" style="font-size:13px;height:30px;font-weight:600;">备注</td>
          <td align="left" colspan="5" rowspan="6">{{ treeData.remark }}</td>
        </tr>
      </table>

      <!--招采审批中标-->
      <table border="1" width="100%" bordercolor="#999"
        v-if="receiptsModel === '6' || receiptsModel === '7' || receiptsModel === '8' || receiptsModel === '9'"
        style="margin-bottom: 5px;font-size: 13px;">
        <tr>
          <td align="center" width="25%" style="font-size:13px;height:30px;font-weight:600;">中标候选人名称</td>
          <td align="center" width="15%" style="font-size:13px;height:30px;font-weight:600;">联系人</td>
          <td align="center" width="20%" style="font-size:13px;height:30px;font-weight:600;">联系电话</td>
          <td align="center" width="10%" style="font-size:13px;height:30px;font-weight:600;">税率</td>
          <td align="center" width="15%" style="font-size:13px;height:30px;font-weight:600;">含税金额</td>
          <td align="center" width="15%" style="font-size:13px;height:30px;font-weight:600;">不含税金额</td>
        </tr>
        <tr v-for="(ite,ind) in companyList" :key="ind" style="width: 100%;">
          <td align="center" width="25%" style="height: 30px;">{{ite.name}}</td>
          <td align="center" width="15%" style="height: 30px;">{{ite.relation}}</td>
          <td align="center" width="20%" style="height: 30px;">{{ite.phone}}</td>
          <td align="center" width="10%" style="height: 30px;">{{ite.taxRate}}%</td>
          <td align="center" width="15%" style="height: 30px;">{{ite.taxInclusiveMoney}}</td>
          <td align="center" width="15%" style="height: 30px;">{{ite.money}}</td>
        </tr>
      </table>

      <div style="display: flex;flex-wrap: wrap;width: 100%;">
        <table v-for="(item, index) in list" :key="index" border="1" bordercolor="#999"
          style="width: 49%;margin-bottom: 5px;font-size: 13px;" :style="{'margin-right':(index+1)%2 == 0?'0%':'2%'}">
          <tr style="width: 100%;height: 30px;">
            <td align="center" width="16%" style="font-size:13px;height:30px;font-weight:600;">审批部门</td>
            <td align="center" width="16%">{{ item.departName }}</td>
            <td align="center" width="16%" style="font-size:13px;height:30px;font-weight:600;">审批人</td>
            <td align="center" width="16%">{{ item.realname }}</td>
            <td align="center" width="16%" style="font-size:13px;height:30px;font-weight:600;">审批时间</td>
            <td align="center" width="20%" style="font-size:12px;">{{ item.updateTime }}</td>
          </tr>
          <tr style="width: 100%;min-height: 30px;">
            <td align="center" width="16%" style="font-size:13px;font-weight:600;">意见</td>
            <td colspan="3" width="48%">{{ item.feedback }}</td>
            <td align="center" width="16%" style="font-size:13px;font-weight:600;">签字</td>
            <td align="center" width="20%">
              <img :src="item.signature" alt="" preview="2"
                style="max-width: 100%;width: 70px;" />
            </td>
          </tr>
        </table>
      </div>
    </section>
    <div class="no-print" style="display: inline-block; width: 100%; text-align: right">
      <a-button ghost type="primary" right @click="handleCancel">取消</a-button>
      <!-- <a-button @click="handleClickDownloadFile"><a-icon type="download"/>&nbsp;下载</a-button> -->
      <a-button v-print="'#printContent'" style="margin-left: 20px" type="primary">打印</a-button>
    </div>
  </j-modal>
</template>

<script>
  import ExcelJS from 'exceljs'
  import {
    saveAs
  } from 'file-saver'
  import {
    httpAction,
    getAction
  } from '@api/manage'

  //  import { mixinDevice } from '@/utils/mixin'
  // import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  //  item.supplierName, supplierPriceItem.publicBiddingName
  const renderContent = (value, row, index) => {
    const obj = {
      children: value,
      attrs: {},
    }
    // console.log(value)
    // console.log(row)
    // console.log(index)

    if (index === 1) {
      obj.attrs.rowSpan = 2
    }

    // These two are merged into above cell
    if (index === 2) {
      obj.attrs.rowSpan = 0
    }

    return obj
  }

  import Bus from './bus'
  export default {
    name: 'huiqian',
    // mixins: [JeecgListMixin, mixinDevice],
    props: {
      value: Boolean,
      /* billsTemplateName:{
        type: String,
        default: '',
      },
      receiptsModel:{
        type: String,
        default: '',
      }, */
    },
    components: {},
    data() {
      return {
        title: '发标',
        id: '',
        width: 1300,
        visible: false,
        billsTemplateName: '',
        receiptsModel: '',
        disableSubmit1: true,
        confirmLoading: false,
        profitabilityAnalysis: '',
        remark: '',
        loading: false,
        list: [],
        companyList: [],
        treeData: {},
        url: {
          list: '/bidding/wtBiddingSupplier/list',
        },
      }
    },
    computed: {},
    methods: {
      retrieve(record, type) {
        let ret = false;
        if (record.indexOf(type) != -1) {
          ret = true;
        } else {
          ret = false;
        }
        return ret
      },
      edit(record) {
        console.log(1, record)
        this.visible = true
        // console.log('ewq', record)
        this.billsTemplateName = record.billsTemplateName;
        this.receiptsModel = record.receiptsModel;
        this.loadTree(record)
        // console.log('dewq', this.billsTemplateName)
      },
      loadTree(record) {
        let id = '';
        if (!!record) {
          id = record.id
        }
        this.treeData = {};
        this.list = [];
        getAction(`/countersign/wtCountersign/getPintPreviewData?id=${id}`).then((res) => {
          if (res.success) {
            if (!!res.result.wtCountersignDetail) {
              this.treeData = res.result.wtCountersignDetail;
            }
            if (res.result.list && res.result.list.length > 0) {
              this.list = res.result.list;
            }
            if (res.result.companyList && res.result.companyList.length > 0) {
              this.companyList = res.result.companyList;
            }
            this.$forceUpdate();
          }
        })
      },
      add() {
        this.visible = true
      },

      close() {
        this.$emit('close')
        this.visible = false
      },
      handleCancel() {
        this.close()
      },
    },
  }
</script>
<style scoped>
  .div1 {
    width: 100%;
    text-align: center;
    font-size: 16px;
  }

  /*update_begin author:scott date:20191203 for:打印机打印的字体模糊问题 */
  * {
    color: #000000 !important;
    -webkit-tap-highlight-color: #000000 !important;
  }

  /*update_end author:scott date:20191203 for:打印机打印的字体模糊问题 */

  .abcdefg .ant-card-body {
    margin-left: 0%;
    margin-right: 0%;
    margin-bottom: 1%;
    border: 0px solid black;
    min-width: 800px;
    color: #000000 !important;
  }

  .explain {
    text-align: left;
    margin-left: 50px;
    color: #000000 !important;
  }

  .explain .ant-input,
  .sign .ant-input {
    font-weight: bolder;
    text-align: center;
    border-left-width: 0px !important;
    border-top-width: 0px !important;
    border-right-width: 0px !important;
  }

  .explain div {
    margin-bottom: 10px;
  }

  /* you can make up upload button and sample style by using stylesheets */
  .ant-upload-select-picture-card i {
    font-size: 32px;
    color: #999;
  }

  .ant-upload-select-picture-card .ant-upload-text {
    margin-top: 8px;
    color: #666;
  }
</style>